const getServerSideProps = async (context) => { const res = await fetch('http://localhost:3000/api' + context.resolvedUrl); const data = await res.json(); return { props: { data } }; } const Main = ({ data }) => { switch (data.resultType) { case 'data': return (